/**************************************************************************************
* MapSpecial.java
* 
* Special pre-generated areas. Defines basics which are filled in during level generation
*************************************************************************************/
package creid.mythos.engine;

import java.util.HashMap;

public class MapSpecial
{
	//--------------------------------------------------------
	// Constants
	//--------------------------------------------------------

	//Standard wall/floor constants
	public static final char WALL_CHAR = '|'; 
	public static final char FLOOR_CHAR = '.'; 
	public static final char DOOR_CHAR = '+'; 
	
	//--------------------------------------------------------
	// Attributes
	//--------------------------------------------------------

	//The room specification
	private char[][] room;
	
	private int roomX;
	private int roomY;
	
	//Designated items, mobs, terrain, or other objects
	private HashMap<Character, String> specials;
	
	//whether this room can be randomly generated or not
	private int level;
	private int rarity;
	
	//--------------------------------------------------------
	// Constructors
	//--------------------------------------------------------
	
	public MapSpecial(char[][] roomMap, String[] mSpecials, int rarity)
	{
		this.room = roomMap;
		this.specials = new HashMap<Character, String>();
		
		if (mSpecials == null)
			mSpecials = new String[0];
		
		for (int i = 0; i < mSpecials.length; i++)
		{
			//Format is
			char key = mSpecials[i].charAt(0);
			String value = mSpecials[i].subSequence(2, mSpecials[i].length()).toString();
			
			specials.put(key, value);
		}
		
		roomX = -1;
		roomY = -1;
		this.rarity = rarity;
	}
	
	//--------------------------------------------------------
	// Getters and Setters
	//--------------------------------------------------------

	public String getSpecial(char key)
	{
		return specials.get(key);
	}
	
	public char[][] getRoom()
	{
		return room;
	}

	public void setRoom(char[][] room)
	{
		this.room = room;
	}
	
	public int getRarity()
	{
		return rarity;
	}

	public void setRarity(int rarity)
	{
		this.rarity = rarity;
	}

	public int getLevel()
	{
		return level;
	}

	public void setLevel(int level)
	{
		this.level = level;
	}

	public int getRoomX()
	{
		return roomX;
	}

	public void setRoomX(int roomX)
	{
		this.roomX = roomX;
	}

	public int getRoomY()
	{
		return roomY;
	}

	public void setRoomY(int roomY)
	{
		this.roomY = roomY;
	}
}